using System;
using System.Text;
using System.Collections.Generic;
using System.Data;
using System.Data.Common;
using iBeauty.BusinessObjects;

namespace iBeauty.DAL
{
	public class EmailSettingDAO
	{
		public EmailSettingDAO()
		{
			DbProviderHelper.GetConnection();
		}
		public List<EmailSetting> GetEmailSettings()
		{
			try
			{
				List<EmailSetting> lstEmailSettings = new List<EmailSetting>();
				DbCommand oDbCommand = DbProviderHelper.CreateCommand("SELECT [ID],[CreateDate],[ModifiedDate],[TimeStamp],[Email],[SmtpUrl],[SmtpPort],[SmtpUser],[SmtpPassword],[IsSsl],[AccountId],[Note] FROM [EmailSetting]",CommandType.Text);
				DbDataReader oDbDataReader = DbProviderHelper.ExecuteReader(oDbCommand);
				while (oDbDataReader.Read())
				{
					EmailSetting oEmailSetting = new EmailSetting();
					oEmailSetting.ID = Convert.ToString(oDbDataReader["ID"]);

					if(oDbDataReader["CreateDate"] != DBNull.Value)
						oEmailSetting.CreateDate = Convert.ToDateTime(oDbDataReader["CreateDate"]);

					if(oDbDataReader["ModifiedDate"] != DBNull.Value)
						oEmailSetting.ModifiedDate = Convert.ToDateTime(oDbDataReader["ModifiedDate"]);

					if(oDbDataReader["TimeStamp"] != DBNull.Value)
						oEmailSetting.TimeStamp = Convert.ToDateTime(oDbDataReader["TimeStamp"]);

					if(oDbDataReader["Email"] != DBNull.Value)
						oEmailSetting.Email = Convert.ToString(oDbDataReader["Email"]);

					if(oDbDataReader["SmtpUrl"] != DBNull.Value)
						oEmailSetting.SmtpUrl = Convert.ToString(oDbDataReader["SmtpUrl"]);

					if(oDbDataReader["SmtpPort"] != DBNull.Value)
						oEmailSetting.SmtpPort = Convert.ToInt32(oDbDataReader["SmtpPort"]);

					if(oDbDataReader["SmtpUser"] != DBNull.Value)
						oEmailSetting.SmtpUser = Convert.ToString(oDbDataReader["SmtpUser"]);

					if(oDbDataReader["SmtpPassword"] != DBNull.Value)
						oEmailSetting.SmtpPassword = Convert.ToString(oDbDataReader["SmtpPassword"]);

					if(oDbDataReader["IsSsl"] != DBNull.Value)
						oEmailSetting.IsSsl = Convert.ToString(oDbDataReader["IsSsl"]);

					if(oDbDataReader["AccountId"] != DBNull.Value)
						oEmailSetting.AccountId = Convert.ToInt32(oDbDataReader["AccountId"]);

					if(oDbDataReader["Note"] != DBNull.Value)
						oEmailSetting.Note = Convert.ToString(oDbDataReader["Note"]);
					lstEmailSettings.Add(oEmailSetting);
				}
				oDbDataReader.Close();
				return lstEmailSettings;
			}
			catch (Exception ex)
			{
				throw ex;
			}
		}
		public EmailSetting GetEmailSetting(string ID)
		{
			try
			{
				EmailSetting oEmailSetting = new EmailSetting();
				DbCommand oDbCommand = DbProviderHelper.CreateCommand("SELECT [ID],[CreateDate],[ModifiedDate],[TimeStamp],[Email],[SmtpUrl],[SmtpPort],[SmtpUser],[SmtpPassword],[IsSsl],[AccountId],[Note] FROM [EmailSetting] WHERE [ID]=@ID",CommandType.Text);
				oDbCommand.Parameters.Add(DbProviderHelper.CreateParameter("@ID",DbType.String,ID));
				DbDataReader oDbDataReader = DbProviderHelper.ExecuteReader(oDbCommand);
				while (oDbDataReader.Read())
				{
					oEmailSetting.ID = Convert.ToString(oDbDataReader["ID"]);

					if(oDbDataReader["CreateDate"] != DBNull.Value)
						oEmailSetting.CreateDate = Convert.ToDateTime(oDbDataReader["CreateDate"]);

					if(oDbDataReader["ModifiedDate"] != DBNull.Value)
						oEmailSetting.ModifiedDate = Convert.ToDateTime(oDbDataReader["ModifiedDate"]);

					if(oDbDataReader["TimeStamp"] != DBNull.Value)
						oEmailSetting.TimeStamp = Convert.ToDateTime(oDbDataReader["TimeStamp"]);

					if(oDbDataReader["Email"] != DBNull.Value)
						oEmailSetting.Email = Convert.ToString(oDbDataReader["Email"]);

					if(oDbDataReader["SmtpUrl"] != DBNull.Value)
						oEmailSetting.SmtpUrl = Convert.ToString(oDbDataReader["SmtpUrl"]);

					if(oDbDataReader["SmtpPort"] != DBNull.Value)
						oEmailSetting.SmtpPort = Convert.ToInt32(oDbDataReader["SmtpPort"]);

					if(oDbDataReader["SmtpUser"] != DBNull.Value)
						oEmailSetting.SmtpUser = Convert.ToString(oDbDataReader["SmtpUser"]);

					if(oDbDataReader["SmtpPassword"] != DBNull.Value)
						oEmailSetting.SmtpPassword = Convert.ToString(oDbDataReader["SmtpPassword"]);

					if(oDbDataReader["IsSsl"] != DBNull.Value)
						oEmailSetting.IsSsl = Convert.ToString(oDbDataReader["IsSsl"]);

					if(oDbDataReader["AccountId"] != DBNull.Value)
						oEmailSetting.AccountId = Convert.ToInt32(oDbDataReader["AccountId"]);

					if(oDbDataReader["Note"] != DBNull.Value)
						oEmailSetting.Note = Convert.ToString(oDbDataReader["Note"]);
				}
				oDbDataReader.Close();
				return oEmailSetting;
			}
			catch (Exception ex)
			{
				throw ex;
			}
		}
		public int AddEmailSetting(string ID,DateTime?CreateDate,DateTime?ModifiedDate,DateTime?TimeStamp,string Email,string SmtpUrl,int?SmtpPort,string SmtpUser,string SmtpPassword,string IsSsl,int?AccountId,string Note)
		{
			try
			{
				DbCommand oDbCommand = DbProviderHelper.CreateCommand("INSERT INTO [EmailSetting]([CreateDate],[ModifiedDate],[TimeStamp],[Email],[SmtpUrl],[SmtpPort],[SmtpUser],[SmtpPassword],[IsSsl],[AccountId],[Note])VALUES(@CreateDate,@ModifiedDate,@TimeStamp,@Email,@SmtpUrl,@SmtpPort,@SmtpUser,@SmtpPassword,@IsSsl,@AccountId,@Note)",CommandType.Text);
				if (CreateDate.HasValue)
					oDbCommand.Parameters.Add(DbProviderHelper.CreateParameter("@CreateDate",DbType.DateTime,CreateDate));
				else
					oDbCommand.Parameters.Add(DbProviderHelper.CreateParameter("@CreateDate",DbType.DateTime,DBNull.Value));
				if (ModifiedDate.HasValue)
					oDbCommand.Parameters.Add(DbProviderHelper.CreateParameter("@ModifiedDate",DbType.DateTime,ModifiedDate));
				else
					oDbCommand.Parameters.Add(DbProviderHelper.CreateParameter("@ModifiedDate",DbType.DateTime,DBNull.Value));
				if (TimeStamp.HasValue)
					oDbCommand.Parameters.Add(DbProviderHelper.CreateParameter("@TimeStamp",DbType.DateTime,TimeStamp));
				else
					oDbCommand.Parameters.Add(DbProviderHelper.CreateParameter("@TimeStamp",DbType.DateTime,DBNull.Value));
				if (Email!=null)
					oDbCommand.Parameters.Add(DbProviderHelper.CreateParameter("@Email",DbType.String,Email));
				else
					oDbCommand.Parameters.Add(DbProviderHelper.CreateParameter("@Email",DbType.String,DBNull.Value));
				if (SmtpUrl!=null)
					oDbCommand.Parameters.Add(DbProviderHelper.CreateParameter("@SmtpUrl",DbType.String,SmtpUrl));
				else
					oDbCommand.Parameters.Add(DbProviderHelper.CreateParameter("@SmtpUrl",DbType.String,DBNull.Value));
				if (SmtpPort.HasValue)
					oDbCommand.Parameters.Add(DbProviderHelper.CreateParameter("@SmtpPort",DbType.Int32,SmtpPort));
				else
					oDbCommand.Parameters.Add(DbProviderHelper.CreateParameter("@SmtpPort",DbType.Int32,DBNull.Value));
				if (SmtpUser!=null)
					oDbCommand.Parameters.Add(DbProviderHelper.CreateParameter("@SmtpUser",DbType.String,SmtpUser));
				else
					oDbCommand.Parameters.Add(DbProviderHelper.CreateParameter("@SmtpUser",DbType.String,DBNull.Value));
				if (SmtpPassword!=null)
					oDbCommand.Parameters.Add(DbProviderHelper.CreateParameter("@SmtpPassword",DbType.String,SmtpPassword));
				else
					oDbCommand.Parameters.Add(DbProviderHelper.CreateParameter("@SmtpPassword",DbType.String,DBNull.Value));
				if (IsSsl!=null)
					oDbCommand.Parameters.Add(DbProviderHelper.CreateParameter("@IsSsl",DbType.String,IsSsl));
				else
					oDbCommand.Parameters.Add(DbProviderHelper.CreateParameter("@IsSsl",DbType.String,DBNull.Value));
				if (AccountId.HasValue)
					oDbCommand.Parameters.Add(DbProviderHelper.CreateParameter("@AccountId",DbType.Int32,AccountId));
				else
					oDbCommand.Parameters.Add(DbProviderHelper.CreateParameter("@AccountId",DbType.Int32,DBNull.Value));
				if (Note!=null)
					oDbCommand.Parameters.Add(DbProviderHelper.CreateParameter("@Note",DbType.String,Note));
				else
					oDbCommand.Parameters.Add(DbProviderHelper.CreateParameter("@Note",DbType.String,DBNull.Value));

				return DbProviderHelper.ExecuteNonQuery(oDbCommand);
			}
			catch (Exception ex)
			{
				throw ex;
			}
		}
		public int AddEmailSetting(EmailSetting oEmailSetting)
		{
			try
			{
				DbCommand oDbCommand = DbProviderHelper.CreateCommand("INSERT INTO [EmailSetting]([CreateDate],[ModifiedDate],[TimeStamp],[Email],[SmtpUrl],[SmtpPort],[SmtpUser],[SmtpPassword],[IsSsl],[AccountId],[Note])VALUES(@CreateDate,@ModifiedDate,@TimeStamp,@Email,@SmtpUrl,@SmtpPort,@SmtpUser,@SmtpPassword,@IsSsl,@AccountId,@Note)",CommandType.Text);
				if (oEmailSetting.CreateDate.HasValue)
					oDbCommand.Parameters.Add(DbProviderHelper.CreateParameter("@CreateDate",DbType.DateTime,oEmailSetting.CreateDate));
				else
					oDbCommand.Parameters.Add(DbProviderHelper.CreateParameter("@CreateDate",DbType.DateTime,DBNull.Value));
				if (oEmailSetting.ModifiedDate.HasValue)
					oDbCommand.Parameters.Add(DbProviderHelper.CreateParameter("@ModifiedDate",DbType.DateTime,oEmailSetting.ModifiedDate));
				else
					oDbCommand.Parameters.Add(DbProviderHelper.CreateParameter("@ModifiedDate",DbType.DateTime,DBNull.Value));
				if (oEmailSetting.TimeStamp.HasValue)
					oDbCommand.Parameters.Add(DbProviderHelper.CreateParameter("@TimeStamp",DbType.DateTime,oEmailSetting.TimeStamp));
				else
					oDbCommand.Parameters.Add(DbProviderHelper.CreateParameter("@TimeStamp",DbType.DateTime,DBNull.Value));
				if (oEmailSetting.Email!=null)
					oDbCommand.Parameters.Add(DbProviderHelper.CreateParameter("@Email",DbType.String,oEmailSetting.Email));
				else
					oDbCommand.Parameters.Add(DbProviderHelper.CreateParameter("@Email",DbType.String,DBNull.Value));
				if (oEmailSetting.SmtpUrl!=null)
					oDbCommand.Parameters.Add(DbProviderHelper.CreateParameter("@SmtpUrl",DbType.String,oEmailSetting.SmtpUrl));
				else
					oDbCommand.Parameters.Add(DbProviderHelper.CreateParameter("@SmtpUrl",DbType.String,DBNull.Value));
				if (oEmailSetting.SmtpPort.HasValue)
					oDbCommand.Parameters.Add(DbProviderHelper.CreateParameter("@SmtpPort",DbType.Int32,oEmailSetting.SmtpPort));
				else
					oDbCommand.Parameters.Add(DbProviderHelper.CreateParameter("@SmtpPort",DbType.Int32,DBNull.Value));
				if (oEmailSetting.SmtpUser!=null)
					oDbCommand.Parameters.Add(DbProviderHelper.CreateParameter("@SmtpUser",DbType.String,oEmailSetting.SmtpUser));
				else
					oDbCommand.Parameters.Add(DbProviderHelper.CreateParameter("@SmtpUser",DbType.String,DBNull.Value));
				if (oEmailSetting.SmtpPassword!=null)
					oDbCommand.Parameters.Add(DbProviderHelper.CreateParameter("@SmtpPassword",DbType.String,oEmailSetting.SmtpPassword));
				else
					oDbCommand.Parameters.Add(DbProviderHelper.CreateParameter("@SmtpPassword",DbType.String,DBNull.Value));
				if (oEmailSetting.IsSsl!=null)
					oDbCommand.Parameters.Add(DbProviderHelper.CreateParameter("@IsSsl",DbType.String,oEmailSetting.IsSsl));
				else
					oDbCommand.Parameters.Add(DbProviderHelper.CreateParameter("@IsSsl",DbType.String,DBNull.Value));
				if (oEmailSetting.AccountId.HasValue)
					oDbCommand.Parameters.Add(DbProviderHelper.CreateParameter("@AccountId",DbType.Int32,oEmailSetting.AccountId));
				else
					oDbCommand.Parameters.Add(DbProviderHelper.CreateParameter("@AccountId",DbType.Int32,DBNull.Value));
				if (oEmailSetting.Note!=null)
					oDbCommand.Parameters.Add(DbProviderHelper.CreateParameter("@Note",DbType.String,oEmailSetting.Note));
				else
					oDbCommand.Parameters.Add(DbProviderHelper.CreateParameter("@Note",DbType.String,DBNull.Value));

				return DbProviderHelper.ExecuteNonQuery(oDbCommand);
			}
			catch (Exception ex)
			{
				throw ex;
			}
		}
		public int UpdateEmailSetting(string ID,DateTime?CreateDate,DateTime?ModifiedDate,DateTime?TimeStamp,string Email,string SmtpUrl,int?SmtpPort,string SmtpUser,string SmtpPassword,string IsSsl,int?AccountId,string Note)
		{

			try
			{
				DbCommand oDbCommand = DbProviderHelper.CreateCommand("UPDATE [EmailSetting] SET [CreateDate]=@CreateDate,[ModifiedDate]=@ModifiedDate,[TimeStamp]=@TimeStamp,[Email]=@Email,[SmtpUrl]=@SmtpUrl,[SmtpPort]=@SmtpPort,[SmtpUser]=@SmtpUser,[SmtpPassword]=@SmtpPassword,[IsSsl]=@IsSsl,[AccountId]=@AccountId,[Note]=@Note WHERE [ID]=@ID",CommandType.Text);
				if (CreateDate.HasValue)
					oDbCommand.Parameters.Add(DbProviderHelper.CreateParameter("@CreateDate",DbType.DateTime,CreateDate));
				else
					oDbCommand.Parameters.Add(DbProviderHelper.CreateParameter("@CreateDate",DbType.DateTime,DBNull.Value));
				if (ModifiedDate.HasValue)
					oDbCommand.Parameters.Add(DbProviderHelper.CreateParameter("@ModifiedDate",DbType.DateTime,ModifiedDate));
				else
					oDbCommand.Parameters.Add(DbProviderHelper.CreateParameter("@ModifiedDate",DbType.DateTime,DBNull.Value));
				if (TimeStamp.HasValue)
					oDbCommand.Parameters.Add(DbProviderHelper.CreateParameter("@TimeStamp",DbType.DateTime,TimeStamp));
				else
					oDbCommand.Parameters.Add(DbProviderHelper.CreateParameter("@TimeStamp",DbType.DateTime,DBNull.Value));
				if (Email!=null)
					oDbCommand.Parameters.Add(DbProviderHelper.CreateParameter("@Email",DbType.String,Email));
				else
					oDbCommand.Parameters.Add(DbProviderHelper.CreateParameter("@Email",DbType.String,DBNull.Value));
				if (SmtpUrl!=null)
					oDbCommand.Parameters.Add(DbProviderHelper.CreateParameter("@SmtpUrl",DbType.String,SmtpUrl));
				else
					oDbCommand.Parameters.Add(DbProviderHelper.CreateParameter("@SmtpUrl",DbType.String,DBNull.Value));
				if (SmtpPort.HasValue)
					oDbCommand.Parameters.Add(DbProviderHelper.CreateParameter("@SmtpPort",DbType.Int32,SmtpPort));
				else
					oDbCommand.Parameters.Add(DbProviderHelper.CreateParameter("@SmtpPort",DbType.Int32,DBNull.Value));
				if (SmtpUser!=null)
					oDbCommand.Parameters.Add(DbProviderHelper.CreateParameter("@SmtpUser",DbType.String,SmtpUser));
				else
					oDbCommand.Parameters.Add(DbProviderHelper.CreateParameter("@SmtpUser",DbType.String,DBNull.Value));
				if (SmtpPassword!=null)
					oDbCommand.Parameters.Add(DbProviderHelper.CreateParameter("@SmtpPassword",DbType.String,SmtpPassword));
				else
					oDbCommand.Parameters.Add(DbProviderHelper.CreateParameter("@SmtpPassword",DbType.String,DBNull.Value));
				if (IsSsl!=null)
					oDbCommand.Parameters.Add(DbProviderHelper.CreateParameter("@IsSsl",DbType.String,IsSsl));
				else
					oDbCommand.Parameters.Add(DbProviderHelper.CreateParameter("@IsSsl",DbType.String,DBNull.Value));
				if (AccountId.HasValue)
					oDbCommand.Parameters.Add(DbProviderHelper.CreateParameter("@AccountId",DbType.Int32,AccountId));
				else
					oDbCommand.Parameters.Add(DbProviderHelper.CreateParameter("@AccountId",DbType.Int32,DBNull.Value));
				if (Note!=null)
					oDbCommand.Parameters.Add(DbProviderHelper.CreateParameter("@Note",DbType.String,Note));
				else
					oDbCommand.Parameters.Add(DbProviderHelper.CreateParameter("@Note",DbType.String,DBNull.Value));
				oDbCommand.Parameters.Add(DbProviderHelper.CreateParameter("@ID",DbType.String,ID));
				return DbProviderHelper.ExecuteNonQuery(oDbCommand);
			}
			catch (Exception ex)
			{
				throw ex;
			}
		}
		public int UpdateEmailSetting(EmailSetting oEmailSetting)
		{

			try
			{
				DbCommand oDbCommand = DbProviderHelper.CreateCommand("UPDATE [EmailSetting] SET [CreateDate]=@CreateDate,[ModifiedDate]=@ModifiedDate,[TimeStamp]=@TimeStamp,[Email]=@Email,[SmtpUrl]=@SmtpUrl,[SmtpPort]=@SmtpPort,[SmtpUser]=@SmtpUser,[SmtpPassword]=@SmtpPassword,[IsSsl]=@IsSsl,[AccountId]=@AccountId,[Note]=@Note WHERE [ID]=@ID",CommandType.Text);
				if (oEmailSetting.CreateDate.HasValue)
					oDbCommand.Parameters.Add(DbProviderHelper.CreateParameter("@CreateDate",DbType.DateTime,oEmailSetting.CreateDate));
				else
					oDbCommand.Parameters.Add(DbProviderHelper.CreateParameter("@CreateDate",DbType.DateTime,DBNull.Value));
				if (oEmailSetting.ModifiedDate.HasValue)
					oDbCommand.Parameters.Add(DbProviderHelper.CreateParameter("@ModifiedDate",DbType.DateTime,oEmailSetting.ModifiedDate));
				else
					oDbCommand.Parameters.Add(DbProviderHelper.CreateParameter("@ModifiedDate",DbType.DateTime,DBNull.Value));
				if (oEmailSetting.TimeStamp.HasValue)
					oDbCommand.Parameters.Add(DbProviderHelper.CreateParameter("@TimeStamp",DbType.DateTime,oEmailSetting.TimeStamp));
				else
					oDbCommand.Parameters.Add(DbProviderHelper.CreateParameter("@TimeStamp",DbType.DateTime,DBNull.Value));
				if (oEmailSetting.Email!=null)
					oDbCommand.Parameters.Add(DbProviderHelper.CreateParameter("@Email",DbType.String,oEmailSetting.Email));
				else
					oDbCommand.Parameters.Add(DbProviderHelper.CreateParameter("@Email",DbType.String,DBNull.Value));
				if (oEmailSetting.SmtpUrl!=null)
					oDbCommand.Parameters.Add(DbProviderHelper.CreateParameter("@SmtpUrl",DbType.String,oEmailSetting.SmtpUrl));
				else
					oDbCommand.Parameters.Add(DbProviderHelper.CreateParameter("@SmtpUrl",DbType.String,DBNull.Value));
				if (oEmailSetting.SmtpPort.HasValue)
					oDbCommand.Parameters.Add(DbProviderHelper.CreateParameter("@SmtpPort",DbType.Int32,oEmailSetting.SmtpPort));
				else
					oDbCommand.Parameters.Add(DbProviderHelper.CreateParameter("@SmtpPort",DbType.Int32,DBNull.Value));
				if (oEmailSetting.SmtpUser!=null)
					oDbCommand.Parameters.Add(DbProviderHelper.CreateParameter("@SmtpUser",DbType.String,oEmailSetting.SmtpUser));
				else
					oDbCommand.Parameters.Add(DbProviderHelper.CreateParameter("@SmtpUser",DbType.String,DBNull.Value));
				if (oEmailSetting.SmtpPassword!=null)
					oDbCommand.Parameters.Add(DbProviderHelper.CreateParameter("@SmtpPassword",DbType.String,oEmailSetting.SmtpPassword));
				else
					oDbCommand.Parameters.Add(DbProviderHelper.CreateParameter("@SmtpPassword",DbType.String,DBNull.Value));
				if (oEmailSetting.IsSsl!=null)
					oDbCommand.Parameters.Add(DbProviderHelper.CreateParameter("@IsSsl",DbType.String,oEmailSetting.IsSsl));
				else
					oDbCommand.Parameters.Add(DbProviderHelper.CreateParameter("@IsSsl",DbType.String,DBNull.Value));
				if (oEmailSetting.AccountId.HasValue)
					oDbCommand.Parameters.Add(DbProviderHelper.CreateParameter("@AccountId",DbType.Int32,oEmailSetting.AccountId));
				else
					oDbCommand.Parameters.Add(DbProviderHelper.CreateParameter("@AccountId",DbType.Int32,DBNull.Value));
				if (oEmailSetting.Note!=null)
					oDbCommand.Parameters.Add(DbProviderHelper.CreateParameter("@Note",DbType.String,oEmailSetting.Note));
				else
					oDbCommand.Parameters.Add(DbProviderHelper.CreateParameter("@Note",DbType.String,DBNull.Value));
				oDbCommand.Parameters.Add(DbProviderHelper.CreateParameter("@ID",DbType.String,oEmailSetting.ID));
				return DbProviderHelper.ExecuteNonQuery(oDbCommand);
			}
			catch (Exception ex)
			{
				throw ex;
			}
		}
		public int RemoveEmailSetting(EmailSetting oEmailSetting)
		{

			try
			{
				DbCommand oDbCommand = DbProviderHelper.CreateCommand("DELETE FROM [EmailSetting] WHERE [ID]=@ID",CommandType.Text);
				oDbCommand.Parameters.Add(DbProviderHelper.CreateParameter("@ID",DbType.String,oEmailSetting.ID));
				return DbProviderHelper.ExecuteNonQuery(oDbCommand);
			}
			catch (Exception ex)
			{
				throw ex;
			}
		}
		public int RemoveEmailSetting(string ID)
		{

			try
			{
				DbCommand oDbCommand = DbProviderHelper.CreateCommand("DELETE FROM [EmailSetting] WHERE [ID]=@ID",CommandType.Text);
				oDbCommand.Parameters.Add(DbProviderHelper.CreateParameter("@ID",DbType.String,ID));
				return DbProviderHelper.ExecuteNonQuery(oDbCommand);
			}
			catch (Exception ex)
			{
				throw ex;
			}
		}
	}
}
